<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021-04-27
 * Time: 21:06
 */
namespace app\admin\controller\command;

class MyMiddle
{
    public function handle($request,\Closure $next){
        if(!in_array($request->url(),['/index.php/admin/login/login','/admin/login/login'])){
            $adminuser = session('adminuser');
//            var_dump($adminuser);
            if(empty($adminuser)){
//                echo 'haha';
                return redirect('/admin/login/login');
            }
        }
//        return response($request->pa)
        return $next($request);
    }
}